package com.my.validated;

import com.my.validated.model.OnlineCourseSaveVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author timo 2021/4/13
 */
@RestController
@RequestMapping("web/onlineCourse")
@Slf4j
public class OnlineCourseController {

    /**
     * 添加或修改
     * @return
     */
    @PostMapping("saveOrUpdate")
    public String saveOrUpdate(@RequestBody @Validated OnlineCourseSaveVo save) {
        return "ok";
    }

//    public String test(){
//        BeanValidators.validateWithException(validator, user);
//        return null;
//    }
}
